home *** CD-ROM | disk | FTP | other *** search
- // DvocxPpg.cpp : Implementation of the CDvocxPropPage property page class.
-
- #include "stdafx.h"
- #include "dvocx.h"
- #include "DvocxPpg.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
-
- IMPLEMENT_DYNCREATE(CDvocxPropPage, COlePropertyPage)
-
-
- /////////////////////////////////////////////////////////////////////////////
- // Message map
-
- BEGIN_MESSAGE_MAP(CDvocxPropPage, COlePropertyPage)
- //{{AFX_MSG_MAP(CDvocxPropPage)
- ON_BN_CLICKED(IDC_FILES, OnFiles)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
-
- /////////////////////////////////////////////////////////////////////////////
- // Initialize class factory and guid
-
- IMPLEMENT_OLECREATE_EX(CDvocxPropPage, "DVOCX.DvocxPropPage.1",
- 0xf1e0ab14, 0xa1af, 0x11cf, 0xa7, 0x5e, 0x20, 0x4c, 0x4f, 0x4f, 0x50, 0x20)
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CDvocxPropPage::CDvocxPropPageFactory::UpdateRegistry -
- // Adds or removes system registry entries for CDvocxPropPage
-
- BOOL CDvocxPropPage::CDvocxPropPageFactory::UpdateRegistry(BOOL bRegister)
- {
- if (bRegister)
- return AfxOleRegisterPropertyPageClass(AfxGetInstanceHandle(),
- m_clsid, IDS_DVOCX_PPG);
- else
- return AfxOleUnregisterClass(m_clsid, NULL);
- }
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CDvocxPropPage::CDvocxPropPage - Constructor
-
- CDvocxPropPage::CDvocxPropPage() :
- COlePropertyPage(IDD, IDS_DVOCX_PPG_CAPTION)
- {
- //{{AFX_DATA_INIT(CDvocxPropPage)
- m_fUseDblBuf = FALSE;
- m_viewFile = _T("");
- m_updateRate = 0;
- m_autoUpdate = FALSE;
- m_scale = 0.0;
- //}}AFX_DATA_INIT
- }
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CDvocxPropPage::DoDataExchange - Moves data between page and properties
-
- void CDvocxPropPage::DoDataExchange(CDataExchange* pDX)
- {
- //{{AFX_DATA_MAP(CDvocxPropPage)
- DDP_Check(pDX, IDC_DBL_BUF, m_fUseDblBuf, _T("UseDoubleBuffering") );
- DDX_Check(pDX, IDC_DBL_BUF, m_fUseDblBuf);
- DDP_Text(pDX, IDC_VIEW_FILE, m_viewFile, _T("ViewFile") );
- DDX_Text(pDX, IDC_VIEW_FILE, m_viewFile);
- DDP_Text(pDX, IDC_UPDATE_RATE, m_updateRate, _T("UpdateRate") );
- DDX_Text(pDX, IDC_UPDATE_RATE, m_updateRate);
- DDP_Check(pDX, IDC_UPDATE, m_autoUpdate, _T("AutoUpdate") );
- DDX_Check(pDX, IDC_UPDATE, m_autoUpdate);
- DDP_Text(pDX, IDC_SCALE, m_scale, _T("Scale") );
- DDX_Text(pDX, IDC_SCALE, m_scale);
- //}}AFX_DATA_MAP
- DDP_PostProcessing(pDX);
- }
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CDvocxPropPage message handlers
-
- void CDvocxPropPage::OnFiles()
- {
- CFileDialog dlg(TRUE);
- char * szFilter = "View Files (*.v)\0*.v\0 Sub-drawings (*.sd)\0 *.sd\0 Layout files (*.lay)\0 *.lay\0All Files (*.*)\0 *.*\0";
-
- dlg.m_ofn.lpstrFilter = szFilter;
- dlg.m_ofn.nFilterIndex = 1;
- dlg.m_ofn.lpstrTitle = "Load DataViews View File";
- if (dlg.DoModal() == IDCANCEL)
- return;
-
- SetDlgItemText(IDC_VIEW_FILE, dlg.GetPathName());
- }
-